home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / pcxbgi1.exe / lha / TP.DOC < prev    next >
Text File  |  1991-03-03  |  4KB  |  83 lines

  1.  
  2.  
  3.               How To Use PCX2BGI Images In Turbo Pascal Programs
  4.                       By Marty Balash, Waterbury CT
  5.  
  6.     Draw your images using a paint program such as Deluxe Paint or
  7.   PC-Paintbrush, which save in .LBM or .PCX format. If you use another paint
  8.   program, find a commercial or shareware conversion program that will
  9.   convert to .LBM or .PCX - there are many available.  Use the 640x349
  10.   16-color mode of your paint program.
  11.     Following the instructions in PCX2BGI.DOC, use PCX2BGI.EXE to
  12.   load your picture and select a "Partial Screen" type of image save. With
  13.   your picture displayed on the screen, frame and save the sections of the
  14.   picture you would like to use in your program.
  15.     At this point you will have one or more .MJB files in your current
  16.   directory. For each of these files run the Turbo Pascal conversion
  17.   program for each of your .MJB files.
  18. * Example:
  19. *   TPCONV mypic.mjb <Enter>
  20. *
  21. * Sample screen output:
  22. *   TPCONV - By Marty Balash
  23. *     Prepare Header And BGI Data For Turbo Pascal
  24. *
  25. *   Header File "MYPIC.HDR" Created.
  26. *
  27. *   BGI Data File "MYPIC.DAT" Created.
  28. *
  29. *   Array Size For TP Program Is: 7702
  30.  
  31.   The example above produces two files: mypic.hdr and mypic.dat,
  32.   leaving the original file (mypic.mjb) untouched.  The .HDR and .DAT
  33.   files will be read directly by your Turbo Pascal program. The array
  34.   size is important to note.  For this reason, you my want to redirect
  35.   the screen output of TPCONV.EXE to your printer...
  36. * Example:
  37. *   TPCONV mypic.mjb >prn <Enter>
  38.   This is generally a good idea, especially when working with more than
  39.   one image file.
  40.  
  41.   The layout if the header is:
  42. * type imagehdr = record
  43. *   id      : array [1..8] of char; {id       - This should be 'PCX2BGI'}
  44. *   size    : word;                 {size     - For TC programs (not needed)}
  45. *   palette : palettetype;          {palette  - Use SetAllPalette to set}
  46. * end;
  47.   The only thing you really need from the header when using Turbo Pascal is
  48.   the palette.
  49.     If you are using a group of images from the same picture, you will only
  50.   need to read one of the .HDR files created by TPCONV. You can get rid
  51.   of the rest.
  52.     In order to use each of the .DAT image files created by TPCONV, you will
  53.   need to hard-code an array of the correct size for each one. TPCONV
  54.   reports the size you will need for a given image ( "Array Size For TP
  55.   Program Is: ... ").
  56.     The commented demo source file "TPDEMO1.PAS" will read a single image
  57.   from disk and put it on the screen. "TPDEMO2.PAS" will read multiple
  58.   images from disk and animate them on the screen.
  59.  
  60.   If you find these utilities useful, please mail $15.00 to:
  61.     Marty Balash
  62.     2 Pinecrest Dr.
  63.     Prospect CT 06712
  64.  
  65. Files in .ZIP file for Turbo Pascal programmers:
  66. BGI1     DAT    Image used by TPDEMO1.PAS & TPDEMO2.PAS
  67. BGI2     DAT    Image used in TPDEMO2.PAS
  68. BGI3     DAT    Image used in TPDEMO2.PAS
  69. BGI4     DAT    Image used in TPDEMO2.PAS
  70. BGI5     DAT    Image used in TPDEMO2.PAS
  71. BGI6     DAT    Image used in TPDEMO2.PAS
  72. BGI7     DAT    Image used in TPDEMO2.PAS
  73. BGI8     DAT    Image used in TPDEMO2.PAS
  74. TP       DOC    Documentation for Turbo Pascal programmers
  75. TPCONV   EXE    Conversion program needed by Turbo Pascal programmers
  76. TPDEMO2  EXE    Executable Demo
  77. BGI1     HDR    Header used by TPDEMO1.PAS & TPDEMO2.PAS
  78. TPDEMO1  PAS    Source to read and display a single image
  79. TPDEMO2  PAS    Source to read and animate multiple images
  80. DEMO     PCX    The picture that the BGI?.DAT files created with
  81.  
  82. * END OF FILE *
  83.